<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>indent</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<link rel="home" href="index.html" title="Руководство по Smarty">
<link rel="up" href="language.modifiers.html" title="Chapter 5. Модификаторы переменных">
<link rel="prev" href="language.modifier.escape.html" title="escape">
<link rel="next" href="language.modifier.lower.html" title="lower">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">indent</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="language.modifier.escape.html">Prev</a> </td>
<th width="60%" align="center">Chapter 5. Модификаторы переменных</th>
<td width="20%" align="right"> <a accesskey="n" href="language.modifier.lower.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1" title="indent">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="language.modifier.indent"></a>indent</h2></div></div></div>
<p>
   Создает отступы в начале каждой строки, по умолчанию - 4 пробела.
   В качестве необязательных аргументов можно указать количество повторений
   символа и сам символ, который будет использоваться для создания отступов.
   (используйте "\t" для табуляции).
  </p>
<div class="informaltable"><table border="1">
<colgroup>
<col align="center">
<col align="center">
<col align="center">
<col align="center">
<col>
</colgroup>
<thead><tr>
<th align="center">Позиция параметра</th>
<th align="center">Тип</th>
<th align="center">Обязателен</th>
<th align="center">По умолчанию</th>
<th>Описание</th>
</tr></thead>
<tbody>
<tr>
<td align="center">1</td>
<td align="center">integer</td>
<td align="center">Нет</td>
<td align="center">4</td>
<td>Определяет количество повторений символа при создании отступа.</td>
</tr>
<tr>
<td align="center">2</td>
<td align="center">string</td>
<td align="center">Нет</td>
<td align="center">(один пробел)</td>
<td>Символ, который используется при создании отступа.</td>
</tr>
</tbody>
</table></div>
<div class="example">
<a name="id2657895"></a><p class="title"><b>Example 5.11. indent</b></p>
<div class="example-contents">
<pre class="programlisting">

&lt;?php
    
$smarty-&gt;assign('articleTitle',
                'NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.'
                );


?&gt;

   </pre>
<p>
    Шаблон:
   </p>
<pre class="programlisting">

{$articleTitle}

{$articleTitle|indent}

{$articleTitle|indent:10}

{$articleTitle|indent:1:"\t"}

   </pre>
<p>
    Результат обработки:
   </p>
<pre class="screen">

NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.

    NJ judge to rule on nude beach.
    Sun or rain expected today, dark tonight.
    Statistics show that teen pregnancy drops off significantly after 25.

          NJ judge to rule on nude beach.
          Sun or rain expected today, dark tonight.
          Statistics show that teen pregnancy drops off significantly after 25.

        NJ judge to rule on nude beach.
        Sun or rain expected today, dark tonight.
        Statistics show that teen pregnancy drops off significantly after 25.

   </pre>
</div>
</div>
<br class="example-break"><p>
   См. также
   <a class="link" href="language.modifier.strip.html" title="strip">strip</a>,
   <a class="link" href="language.modifier.wordwrap.html" title="wordwrap">wordwrap</a>
   и
   <a class="link" href="language.modifier.spacify.html" title="spacify">spacify</a>.
  </p>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="language.modifier.escape.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="language.modifiers.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="language.modifier.lower.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">escape </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> lower</td>
</tr>
</table>
</div>
</body>
</html>
